#include "BezierColorMap.h"

BezierColorMap* newBezierColorMap() {
	BezierColorMap* map;
	map = (BezierColorMap*) malloc(sizeof(BezierColorMap));
	map->init();
	return map;
}

void BezierColorMap::init() {
	redMap = newBezierInterpolationMap();
	greenMap = newBezierInterpolationMap();
	blueMap = newBezierInterpolationMap();
}

RGB BezierColorMap::getColorForValue(int inputValue) {
	int red = redMap->mapInputValue(inputValue);
	int green = greenMap->mapInputValue(inputValue);
	int blue = blueMap->mapInputValue(inputValue);

	RGB color;
	color.r = red;
	color.g = green;
	color.b = blue;
	return color;
}

